const fs = require("fs-extra");
const pkg = require("../package.json");

exports.getBannerTemplate = function () {
  return `/*!
 * @license ${pkg.name} v${pkg.version}
 * Copyright (c) 2025 snap-axis nobo (MIT Licensed)
 * https://github.com/refline/snap-axis
 */`;
};

function main() {
  {
    const data = fs.readFileSync("./umd/snap-axis.min.js");
    fs.writeFileSync("./umd/snap-axis.min.js", exports.getBannerTemplate() + "\n" + data);
  }

  {
    const data = fs.readFileSync("./umd/snap-axis.js");
    fs.writeFileSync("./umd/snap-axis.js", exports.getBannerTemplate() + "\n" + data);
  }
}

if (require.main === module) {
  main();
}
